﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Bussiness.Manager;
public partial class Control_category : System.Web.UI.UserControl
{

    public string CATEGORYTYPE
    {
        get
        {
            return (string.IsNullOrEmpty(Request["t"]) == false ? Request["t"] : string.Empty);
        }
    }

   
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (!IsPostBack)
            LoadCategory();
    }



    private void LoadCategory()
    {
        string value = "NEWS";
        if (CATEGORYTYPE.Equals("san-pham"))
            value = "PROD";
        DataTable tabCategory = CmsCategoryManager.CreateInstant().GetCategoryListByLang(value, "vi-VN");
        repCategory.DataSource = tabCategory;
        repCategory.DataBind();
    }

    public string GetUrl(object cat)
    {
        if (cat.ToString().ToLower() == "tin-tuc")
        {
            return "News.aspx";
               
        }
        return "default.aspx";
       
    }
}
